﻿using System.Configuration;

namespace Avaxo.Scripting.Configuration
{
    public sealed class LanguageEngineSection : ConfigurationSection
    {
        private static readonly ConfigurationProperty defaultEngine;
        private static readonly ConfigurationProperty engines;
        private static readonly ConfigurationPropertyCollection properties;

        static LanguageEngineSection()
        {
            defaultEngine = new ConfigurationProperty( "defaultEngine", typeof ( string ) );
            engines = new ConfigurationProperty( "engines", typeof ( ProviderSettingsCollection ) );
            properties = new ConfigurationPropertyCollection();
            properties.Add( defaultEngine );
            properties.Add( engines );
        }

        [ConfigurationProperty( "defaultEngine" )]
        public string DefaultEngine
        {
            get { return (string) base[ defaultEngine ]; }
            set { base[ defaultEngine ] = value; }
        }

        [ConfigurationProperty( "engines" )]
        public ProviderSettingsCollection Engines
        {
            get { return (ProviderSettingsCollection) base[ engines ]; }
        }

        protected override ConfigurationPropertyCollection Properties
        {
            get { return properties; }
        }
    }
}